<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="lib/vue.js"></script>
</head>
<body>
<div id="root">
    <button @click="num++">{{num}}</button>
</div>
</body>
<script>
    new Vue({
        el : '#root',
        data:{
            num : 1
        },
        mounted(){
            this.$watch('num',()=>{
                console.log(this.num);
            })
        }
    })
</script>
</html>